home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / virtualdub / VirtualDub-source-1_4d / oshelper.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-20  |  2.7 KB  |  72 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    Copyright (C) 1998-2001 Avery Lee
  3. //
  4. //    This program is free software; you can redistribute it and/or modify
  5. //    it under the terms of the GNU General Public License as published by
  6. //    the Free Software Foundation; either version 2 of the License, or
  7. //    (at your option) any later version.
  8. //
  9. //    This program is distributed in the hope that it will be useful,
  10. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. //    GNU General Public License for more details.
  13. //
  14. //    You should have received a copy of the GNU General Public License
  15. //    along with this program; if not, write to the Free Software
  16. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #ifndef f_OSHELPER_H
  19. #define f_OSHELPER_H
  20.  
  21. #include <windows.h>
  22.  
  23. void Draw3DRect(HDC hDC, LONG x, LONG y, LONG dx, LONG dy, BOOL inverted);
  24.  
  25. HKEY OpenConfigKey(const char *szKeyName);
  26. HKEY CreateConfigKey(const char *szKeyName);
  27. BOOL DeleteConfigValue(const char *szKeyName, const char *szValueName);
  28. BOOL QueryConfigString(const char *szKeyName, const char *szValueName, char *lpBuffer, int cbBuffer);
  29. DWORD QueryConfigBinary(const char *szKeyName, const char *szValueName, char *lpBuffer, int cbBuffer);
  30. BOOL QueryConfigDword(const char *szKeyName, const char *szValueName, DWORD *lpdwData);
  31. BOOL SetConfigString(const char *szKeyName, const char *szValueName, const char *lpBuffer);
  32. BOOL SetConfigBinary(const char *szKeyName, const char *szValueName, const char *lpBuffer, int cbBuffer);
  33. BOOL SetConfigDword(const char *szKeyName, const char *szValueName, DWORD dwData);
  34.  
  35. void HelpSetPath();
  36. const char *HelpGetPath();
  37. void HelpShowHelp(HWND hwnd);
  38. void HelpContext(HWND hwnd, DWORD helpID);
  39. void HelpPopup(HWND hwnd, DWORD helpID);
  40. void HelpPopupByID(HWND hwnd, DWORD ctrlID, const DWORD *lookup);
  41.  
  42. __int64 MyGetDiskFreeSpace(const char *lpRoot);
  43.  
  44. const char *SplitPathName(const char *path);
  45. inline char *SplitPathName(char *path) { return const_cast<char *>(SplitPathName(const_cast<const char *>(path))); }
  46.  
  47. const char *SplitPathExt(const char *path);
  48. inline char *SplitPathExt(char *path) { return const_cast<char *>(SplitPathExt(const_cast<const char *>(path))); }
  49.  
  50. char *SplitPathRoot(char *dst, const char *path);
  51. char *MergePath(char *path, const char *fn);
  52. bool IsFilenameOnFATVolume(const char *pszFilename);
  53.  
  54. void LaunchURL(const char *pURL);
  55.  
  56. class CPUUsageReader {
  57. public:
  58.     CPUUsageReader();
  59.     ~CPUUsageReader();
  60.     int read();
  61.  
  62. private:
  63.     bool fNTMethod;
  64.     HKEY hkeyKernelCPU;
  65.  
  66.     unsigned __int64 kt_last;
  67.     unsigned __int64 ut_last;
  68.     unsigned __int64 st_last;
  69. };
  70.  
  71. #endif
  72.